package com.darrenchan.leetcode;

/**
 * @Desc
 * @Author chenchi03
 * @CreateTime 2020-03-22 21:00
 */
public class Q326 {
    public boolean isPowerOfThree(int n) {
        if(n <= 0) {
            return false;
        }

        return (Math.log10(n) / Math.log10(3)) % 1 == 0;
    }
}
